A Logic for Rewriting Strategies

نویسنده

  • Richard B. Kieburtz
چکیده

As term-rewriting has matured, with applications in areas such as automatic program transformation, the necessity of programmed control for applying rules has become apparent. Early term-rewriting systems used a xed strategy, such as innermost-leftmost matching, choosing among possibly overlapping rules nondeterministically. This mode of control is su cient for a con uent, terminating system of rules. When a rule system is not con uent or its termination cannot be guaranteed, the selection and order in which rules are applied can be critical. Hence, modern rewriting systems have evolved programmable strategies to control rewriting. The introduction of programmed strategies into rewriting systems is fairly recent. A primitive form of control is provided by conditional rewrite systems, in which boolean-valued guards on rules allow the ring condition for a rule to depend upon state variables, as well as critical pair matching between a pattern and a term. However, conditional rewrite rules are not su cient for programming large applications. A programming language is needed to express strategies. In this paper we advocate that strategies are best understood as programs over a domain of terms and that the control of these programs involves recursion and nondeterministic choice. A natural formalism for reasoning about such programs is a weakest-precondition logic in a modality in which predicates are interpreted over a domain of nitely-branching trees. As a modal logic for terms, we have adopted the -calculus [7], enriched with modalities that express path quanti cation in terms. We develop rules in this logic for the constructions of Stratego [12, 13, 15, 14], a domain-speci c language designed speci cally for programming strategies for term rewriting. Stratego provides a compositional semantics with explicit recursion, which allows strategies to be applied at sites deep within terms. Patterns are rst-class constructs of Stratego. As in a logic programming language, conditional control in Stratego is based upon the success or nite failure of strategies, rather than if-then-else expressions that test conditions coded as boolean values. Although essentially a rst-order language, Stratego also employs a restricted form of higher-order strategies, namely term congruences, which lift term constructors to strategy constructors.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Internal strategies in a rewriting implementation of tile systems

Tile logic extends rewriting logic, taking into account rewriting with side-eeects and rewriting synchronization. Since rewriting logic is the semantic basis of several language implementation eeorts, it is interesting to map tile logic back into rewriting logic in a conservative way, to obtain executable speciications of tile systems. The resulting implementation requires a meta-layer to contr...

متن کامل

Rewriting as a Unified Specification Tool for Logic and Control: The ELAN Language

We introduce computational systems to formalise the notion of rewriting directed by user defined strategies. This provides a semantics for ELAN, an environment dedicated to prototype, experiment and study the combination of different deduction systems for constraint solving, theorem proving and logic programming paradigms. Formally, a computational system can be represented as a rewrite theory ...

متن کامل

Representing Strategies for the Connection Calculus in Rewriting Logic

Rewriting logic can be used to prototype systems for automated deduction. In this paper, we illustrate how this approach allows experiments with deduction strategies in a flexible and conceptually satisfying way. This is achieved by exploiting the reflective property of rewriting logic. By specifying a theorem prover in this way one quickly obtains a readable, reliable and reasonably efficient ...

متن کامل

ELAN from a rewriting logic point of view

ELAN implements computational systems, a concept that combines two first class entities: rewrite rules and rewriting strategies. ELAN can be used either as a logical framework or to describe and execute deterministic as well as non-deterministic rule based processes. With the general goal to make precise a rewriting logic based semantics of ELAN, this paper has three contributions: a presentati...

متن کامل

Editorial Reduction strategies in rewriting and programming

Reduction strategies in rewriting and programming have attracted increasing attention within the last few years. New types of reduction strategy have been invented and investigated, and new results on rewriting/computation under particular strategies have been obtained. Research in this field ranges from primarily theoretical questions about reduction strategies to very practical application an...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Electr. Notes Theor. Comput. Sci.

دوره 58  شماره 

صفحات  -

تاریخ انتشار 2001